<?php
namespace app\admin\validate;

use think\Validate;

class Cuser extends Validate
{
    protected $message = [
        'telphone' => '{%telphone_val}',
        'password' => '{%password_val}',
        'password.min' => '{%password_min}',
        'repassword' => '{%repassword_val}',
        'type' => '{%type_val}',
        'status' => '{%status_val}',
    ];

    protected $rule = [
        'telphone' => '/^1[34578]\d{9}$/|require',
        'password' => 'require|min:6',
        'repassword' => 'require|confirm:password',
        'type' => 'require|in:0,1',
        'status' => 'require|in:0,1',

    ];

    protected $scene = [
        'addCuser'   => ['telphone', 'password', 'repassword', 'type', 'status'],
        'editCuser'  => ['telphone', 'password', 'type', 'status'],
        'details'  => ['status','city','signature'],
        'password' => ['password', 'repassword'],
        'status' => ['status'],

    ];
}